%Compute equivalent variation for a given default and normative relevance
%of costs

function[value]=ev_int(gamma,alpha,rho,t,m,maxmatch,d,maxcont,pi,mm)

u_optout = utility_optout(gamma,alpha,rho,t,m,maxmatch,maxcont);
u_optin = utility_optin(alpha,rho,t,m,maxmatch,d);
optout_flag = (u_optout>u_optin);

evaluated_costs = gamma*pi;

value = (ev_optout_int(0,evaluated_costs,alpha,rho,t,m,maxmatch,maxcont,mm).*(optout_flag))...
    + (ev_optin_int(0,alpha,rho,t,m,maxmatch,d,maxcont,mm).*(1-optout_flag));

end

